package Lib3d.Animation;


import java.util.Vector;

/**
 * An animation manger implementation. The manager stores a list of animations.
 * 
 * @author Wassim Chegham
 * @version 0.1
 * @category Animation
 * 
 */
public class AnimationManager {

    private final Vector<SimpleAnimationImpl> animationList;

    AnimationManager() {
        this.animationList = new Vector<SimpleAnimationImpl>();
    }

    public void clearAnimation() {
        this.animationList.clear();
    }

    public void runAnimation(final int i) {
        this.animationList.get(i).run();
    }

    public void runAnimations() {
        for (int i = 0; i < this.animationList.size(); i++) {
            this.animationList.get(i).run();
        }
    }

    void addAnimation(final SimpleAnimationImpl animation) {
        this.animationList.add(animation);
    }
}
